package cn.exempale.mscapplication.dto;

import androidx.annotation.NonNull;

import java.util.Date;

import cn.exempale.mscapplication.constant.BaseConstant;
import cn.exempale.mscapplication.utils.AudioUtils;

public class BaseDTO {

    @NonNull
    private String app_id; // appid
    @NonNull
    private String signa; // 签名
    @NonNull
    private String ts; // 当前时间戳

    public BaseDTO() {
        this.app_id = BaseConstant.APP_ID;
        this.ts = String.valueOf(new Date().getTime());
        this.signa = AudioUtils.getSigna(this);
    }

    @NonNull
    public String getApp_id() {
        return app_id;
    }

    public void setApp_id(@NonNull String app_id) {
        this.app_id = app_id;
    }

    @NonNull
    public String getSigna() {
        return signa;
    }

    public void setSigna(@NonNull String signa) {
        this.signa = signa;
    }

    @NonNull
    public String getTs() {
        return ts;
    }

    public void setTs(@NonNull String ts) {
        this.ts = ts;
    }

    public void refreshSigna() {
        this.signa = AudioUtils.getSigna(this);
    }
}
